<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });
// 前台home
Route::group(['namespace'=>'Home'],function()
{
	// Route::get('/','LoginController@login');
	
	Route::post('/dologin','LoginController@doLogin');
	// Route::get('/index','LoginController@index');
	Route::get('/login','LoginController@login');
	Route::get('/outLogin','LoginController@outLogin');
	Route::group(['middleware'=>'login'],function(){
		Route::get('/','LoginController@index');
		Route::post('/comment/comment','CommentController@comment');
		Route::post('/comment/reply','CommentController@reply');
		Route::get('/news/detailsNews/{id}','NewsController@detailsNews');
	});

});

//后台admin
Route::group(['namespace'=>'Admin' ],function(){
	Route::get('/admin/login','LoginController@login');
	Route::post('/admin/doLogin','LoginController@doLogin');
	Route::get('/admin/loginout','LoginController@loginOut');
	//引入项
	Route::get('/admin/dashboard','UserController@dashboard');

	Route::group(['middleware'=>'admin.login'],function(){
		Route::get('/admin','LoginController@admin');
		Route::get('/admin/index1','UserController@index1');
		Route::post('/admin/index1','UserController@index1');
		Route::get('/admin/add','UserController@add');
		Route::post('/admin/doadd','UserController@doadd');
		Route::post('/admin/del','UserController@del');
		Route::get('/admin/edit/{id}','UserController@edit');
		Route::post('/admin/doedit/{id}','UserController@doedit');
		//搜索
		Route::post('/admin/search','UserController@search');
		//新闻列表
		Route::get('/admin/news','NewsController@newsIndex');
		Route::get('/admin/addnews','NewsController@addNews');
		Route::post('/admin/doaddnews','NewsController@doAddNews');
		Route::post('/admin/delNews','NewsController@delNews');
		Route::get('/admin/news/edit/{id}','NewsController@edit');
		Route::post('/admin/news/doeditnews/{id}','NewsController@doeditnews');
		//评论
		Route::get('/admin/comment/index','CommentController@index');
		Route::get('/admin/comment/details/{id}','CommentController@details');
		Route::post('/admin/comment/disable','CommentController@disable');
		Route::post('/admin/comment/delComment','CommentController@delComment');
		//图片(新闻列表图片)
		Route::get('/admin/picture','PictureController@indexImg');
		Route::get('/admin/picture/addimg','PictureController@addImg');
		Route::post('/admin/picture/doaddImg','PictureController@doaddImg');

	});
});
